package com.lagou.service;

import com.lagou.model.UploadResult;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.OutputStream;

/**
 * 文件接口
 */
public interface FileService {

    /**
     * 上传文件
     *
     * @param multipartFile
     * @return
     * @throws IOException
     */
    UploadResult upload(MultipartFile multipartFile) throws IOException;

    /**
     * 下载文件
     *
     * @param fileName
     * @param outputStream
     * @throws IOException
     */
    void download(String fileName, OutputStream outputStream) throws IOException;

    /**
     * 删除文件
     *
     * @param fileName
     */
    void delete(String fileName);
}
